#pragma once

#include <opencv2/opencv.hpp>
#include <opencv2/dnn.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
#include <string.h>
#include <vector>
#include <fstream>
#include <stdio.h>
#include "../define.h"
#include "../Config/CameraParam.h"

class Detection
{
public:
	Detection();
	~Detection();
	void Read_Model_Armor();
        void Set_WH(int width, int height);
	bool Detecting(cv::Mat frame,std::vector<cv::Rect>&box,std::vector<int> &id);

	std::vector<cv::String> GetOutputsNames();
	void PostProcess();
	void Drawer();
	void DrawBoxes(int classId, float conf, int left, int top, int right, int bottom);
	
	cv::Mat GetFrame();
	int GetResWidth();
	int GetResHeight();

private:
	int m_width;
	int m_height;

	cv::dnn::Net model_armor;
	cv::Mat m_frame;
	cv::Mat m_blob;
	std::vector<cv::Mat> m_outs;
	std::vector<float> m_confs;
	std::vector<cv::Rect> m_boxes;
	std::vector<int> m_classIds;
	std::vector<int> m_perfIndx;

	int m_inpWidth;
	int m_inpHeight;
	float m_confThro;
	float m_NMSThro;
	std::vector<std::string> m_classes;

private:
	void Dump();
};
